using namespace System::Runtime::InteropServices;
using namespace System::Drawing;
using namespace System::Threading;


namespace mygdi
{
enum TernaryRasterOperations
{
srccopy = SRCCOPY ,
srcpaint = SRCPAINT   ,
srcand = SRCAND   ,
srcinvert = SRCINVERT   ,
srcerase = SRCERASE      ,
notsrccopy = NOTSRCCOPY    ,
notsrcerase = NOTSRCERASE ,
mergecopy = MERGECOPY   ,
mergepaint = MERGEPAINT ,
patcopy = PATCOPY   ,
patpaint = PATPAINT  ,
patinvert = PATINVERT  ,
dstinvert = DSTINVERT   ,
blackness = BLACKNESS  ,
whitness = WHITENESS  ,
};
[DllImport("gdi32.dll", EntryPoint="CreateCompatibleDC")]
extern IntPtr CreateCompatibleDC(IntPtr hdc);

[DllImport("gdi32.dll", EntryPoint="SelectObject")]
extern IntPtr SelectObject(IntPtr hdc,IntPtr bmp);

[DllImport( "gdi32.dll", EntryPoint = "TextOut")]
bool TextOut(IntPtr hDC, Int32 iXStart, Int32 iYStart, char* pwcStart, Int32 iLength);

[DllImport("gdi32.dll", EntryPoint = "BitBlt")]
bool BitBlt(IntPtr hObject, int nXDest, int nYDest, int nWidth, int nHeight,
            IntPtr hObjSource, int nXSrc, int nYSrc, TernaryRasterOperations dwRop);

[DllImport("gdi32.dll")]
IntPtr CreateSolidBrush(UInt32 argbColor);

typedef struct SIZE
{
public:
	int cx;
	int cy;
};

[DllImport("gdi32.dll")]
bool Rectangle(IntPtr hdc,int ulCornerX, int ulCornerY,int lrCornerX, int lrCornerY);

[DllImport("gdi32.dll")]
IntPtr CreateFont(int nHeight, int nWidth, int nEscapement,
   int nOrientation, int fnWeight, int fdwItalic, int fdwUnderline, int
   fdwStrikeOut, int fdwCharSet, int fdwOutputPrecision, int
   fdwClipPrecision, int fdwQuality, int fdwPitchAndFamily, string lpszFace);

[DllImport( "gdi32.dll", EntryPoint = "SetBkColor", SetLastError = true )]
UInt32 SetBackColor(IntPtr hDC, UInt32 uiColor);

[DllImport("gdi32.dll")]
bool LineTo(IntPtr hdc, int nXEnd, int nYEnd);

[DllImport("gdi32.dll")]
bool MoveToEx(IntPtr hdc, int x, int y, IntPtr pt);
		
[DllImport("gdi32.dll")]
bool GetTextExtentPoint32(IntPtr hdc, char* s, int len, mygdi::SIZE *size);

[DllImport("user32.dll")]
int FillRect(IntPtr hDC, RECT rect, IntPtr hBrush);

[DllImport("gdi32.dll")]
int SetTextColor(IntPtr hdc, int crColor);

[DllImport("gdi32.dll")]
IntPtr CreatePen(int nPenStyle,int nWidth,int crColor);

[DllImport("gdi32.dll")]
bool Ellipse(IntPtr hdc,int ulCornerX, int ulCornerY,int lrCornerX, int lrCornerY);

}

